Workshop

Part 1 (today)

Get to know healthiar

No need to code!

In the mean time

  • Install healthiar (& RStudio) - We’re here to help!

  • Work on exercises

Part 2 (on 2 April)

  • Exercises walk through (in RStudio)

  • Mock case studies - Your turn!

    • Air pollution & noise
  • Final remarks

Today

1st hour

  • [About healthiar]

  • [The healthiar package in RStudio]

  • Examples

    • [Example: attribute_health() using RR]

    • [Example: attribute_health() with RR & uncertainty]

    • [Example: attribute_health() with AR]

  • Q&A I - Please save your questions!

Break

2nd hour

About healthiar

What’s going on here?

Burden of disease - Relative risk

Burden of disease - Absolute risk

About healthiar (1/5)

Figure: healthiar overview

TODO: update names in poster; make internal testing ticked

About healthiar (2/5)

healthiar core family members (functions)

  • attribute_health() with either relative and absolute risk
  • attribute_lifetable() life table analysis (RR & AR)
  • summary_uncertainty() Monte Carlo simulation
  • attribute_mod() modify an existing assessment
  • compare() two scenarios
  • monetize() health impacts
  • cba() cost-benefit analysis
  • socialize() discovers inequalities in health impacts
  • get_mdi() creates the BEST-COST Multidimensional Deprivation Index (MDI)
  • get_daly() by adding up YLL & YLD

About healthiar (1/5)

BEST-COST GitHub repository

Let’s check out the BEST-COST GitHub repo and the README file

Landing page of the BEST-COST GitHub repo. The README file tells you how to get started. The folder r_package contains package-related files (including function code). Developments are discussed and documented under Issues.

Landing page of the BEST-COST GitHub repo. The README file tells you how to get started. The folder r_package contains package-related files (including function code). Developments are discussed and documented under Issues.

About healthiar (4/5)

Installation

The README file contains the following information

README file of the healthiar R package

About healthiar (5/5)

Example of a healthiar function call

The healthiar package in RStudio

healthiar in RStudio 1/3

RStudio startup screen

healthiar in RStudio 2/3

Post installation, you can access the healthiar package landing page in RStudio by going to the Packages tab and then clicking on the healthiar package.

healthiar in RStudio 3/3

Landing page of the healthiar package in RStudio, where you find the package vignettes and function documentation.

Vignette (1/2)

vignette

long-form guide to a package

The intro vignette introduces healthiar step-by-step and contains (reproducible) examples. You can open the intro_to_healthiar vignette within RStudio or as a HTML within your browser.

Vignette (2/2)

Note

The vignette is a work in progress: we appreciate any feedback or suggestions you might have to make it more useful to future users!

You can access the intro vignette by

  1. going to the Packages tab in RStudio, scrolling to the healthiar package and clicking on healthiar > User guides, package vignettes and other documentation > HTML

  2. running browseVignettes(“healthiar”) in the console and clicking on HTML on the page that pops up

Function documentation (1/3)

Let’s clarify some R jargon

Function documentation (2/3)

Access the function documentation by clicking on a function name in the package landing page.

Tip

Alternatively, access the function documentation with ?attribute_health

Any function documentation contains the following sections:

  • Title Essence of the function

  • Description What does the function do exactly?

  • Usage Bare-minimum examples of how to use the function, including default argument value(s)

  • Arguments Short description of each function argument, e.g. input type (numeric vs. string), options (if available), how each argument affects the output, …

  • Details (optional) Additional details about the function

  • Value Information about the function output

  • Examples (optional) Shows how the function works

Function documentation (3/3)

Important

Any arguments without a “=“ symbol after the name have no default and must be user-specified

For a more detailed function documentation walk through see the Appendix

Example: attribute_health() using RR

Example: attribute_health() with RR

Goal: attribute COPD cases to air pollution

results_pm_copd <-
  healthiar::attribute_health(
    erf_shape = "log_linear", # Alternatives: "linear", "log_log"
    rr_central = 1.369, 
    rr_increment = 10,  # μg / m^3
    exp_central = 8.85, # μg / m^3
    cutoff_central = 5, # μg / m^3
    bhd_central = 30747 # baseline health data: COPD incidence
  ) 

Tip

healthiar comes with some example data that start with exdat_ that allow you to test functions.

results_pm_copd <-
  healthiar::attribute_health(
    erf_shape = "log_linear",
    rr_central = exdat_pm_copd$relative_risk, 
    rr_lower = exdat_pm_copd$relative_risk_lower,
    rr_upper = exdat_pm_copd$relative_risk_upper,
    rr_increment = 10, 
    exp_central = exdat_pm_copd$mean_concentration,
    cutoff_central = exdat_pm_copd$cut_off_value,
    bhd_central = exdat_pm_copd$incidents_per_100_000_per_year/1E5*exdat_pm_copd$population_at_risk,
    # bhd_central = exdat_pm_copd$incidence # Uncomment once change committed to main
  ) 

Output structure

Every attribute output consists of two lists (“folders”)

  • health_main contains the main results

  • health_detailed detailed results (and in some cases even more information about the assessment/calculation)

TODO: add to detailed bullet: interim results, input; add that tibble works like data frame note: add here that format is tibble (but can be changed to data frame)

note: screenshot of how to click on variable in env (put that as first option) . . .

Different ways to access the results

Tip

This is personal preference! However, you might encounter all options.

Go to the Environment tab in RStudio and click on a variable to “open” it. Alternatively, you can use View(results_pm_copd), which has the same effect.

results_pm_copd$health_main$impact_rounded

Note: after typing the $ sign you can see all available options by pressing the tab key and use the arrows & tab keys to select an option (or alternatively use the mouse)

results_pm_copd[["health_main"]]

Note: if the cursor is located within the square braces you can see all available options by pressing the tab key

Using the purrr::pluck function to select a list and then the dplyr::pull function extract values from a specified column

results_pm_copd |> purrr::pluck("health_main") |> dplyr::pull("impact_rounded")

Note: available options can’t be displayed automatically using these functions -> better suited for a more permanent analysis script

Let’s check the main output!

results_pm_copd[["health_main"]]
impact_rounded impact pop_fraction erf_ci rr exp bhd
3502 3501.962 0.1138961 central 1.369 8.85 30747
1353 1353.066 0.0440064 lower 1.124 8.85 30747
5474 5473.888 0.1780300 upper 1.664 8.85 30747

Tip

Each row shows a result obtained with all the input data & calculation pathway specifications shown in that row

Some of the most relevant columns include: - impact_rounded Rounded attributable health impact/burden - impact Raw impact/burden - pop_fraction Population attributable fraction (PAF) - erf_ci Specifies whether rr_central, ..._lower or ..._upper was used in calculation - rr Specifies raw rr used in calculation - - exp - bhd*

Example: attribute_health() with RR & uncertainty

Example: attribute_health() with RR & uncertainty

Goal: attribute lung cancer deaths to PM2.5 exposure

results_pm_copd <-
  healthiar::attribute_health(
    erf_shape = "log_linear",
    rr_central = 1.369, 
    rr_lower = 1.124, 
    rr_upper = 1.664,
    rr_increment = 10, 
    exp_central = 8.85, 
    exp_lower = 8, 
    exp_upper = 10,
    cutoff_central = 5,
    bhd_central = 30747, 
    bhd_lower = 28000, 
    bhd_upper = 32000
  ) 

Let’s check the detailed output!

Tip

See the intro vignette for a detailed description of output columns.

The health_detailed output table contains all different combinations of the arguments with uncertainty. E.g. rr_central with exp_lower and bhd_upper, …

results_pm_copd[["health_detailed"]][["impact_raw"]]
exp_ci bhd_ci erf_ci pop_fraction impact geo_id_disaggregated is_lifetable prop_pop_exp rr_increment erf_shape exposure_name approach_risk exposure_dimension exposure_type exp rr bhd cutoff_ci cutoff pop_fraction_type rr_conc impact_rounded
central central central 0.1138961 3501.9619 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.369 30747 central 5 paf 1.128536 3502
central lower central 0.1138961 3189.0894 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.369 28000 central 5 paf 1.128536 3189
central upper central 0.1138961 3644.6736 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.369 32000 central 5 paf 1.128536 3645
central central lower 0.0440064 1353.0658 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.124 30747 central 5 paf 1.046032 1353
central lower lower 0.0440064 1232.1801 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.124 28000 central 5 paf 1.046032 1232
central upper lower 0.0440064 1408.2058 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.124 32000 central 5 paf 1.046032 1408
central central upper 0.1780300 5473.8882 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.664 30747 central 5 paf 1.216589 5474
central lower upper 0.1780300 4984.8398 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.664 28000 central 5 paf 1.216589 4985
central upper upper 0.1780300 5696.9598 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.85 1.664 32000 central 5 paf 1.216589 5697
lower central central 0.0899213 2764.8092 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.369 30747 central 5 paf 1.098806 2765
lower lower central 0.0899213 2517.7955 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.369 28000 central 5 paf 1.098806 2518
lower upper central 0.0899213 2877.4806 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.369 32000 central 5 paf 1.098806 2877
lower central lower 0.0344604 1059.5528 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.124 30747 central 5 paf 1.035690 1060
lower lower lower 0.0344604 964.8902 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.124 28000 central 5 paf 1.035690 965
lower upper lower 0.0344604 1102.7316 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.124 32000 central 5 paf 1.035690 1103
lower central upper 0.1416706 4355.9450 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.664 30747 central 5 paf 1.165054 4356
lower lower upper 0.1416706 3966.7760 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.664 28000 central 5 paf 1.165054 3967
lower upper upper 0.1416706 4533.4583 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8.00 1.664 32000 central 5 paf 1.165054 4533
upper central central 0.1453304 4468.4726 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.369 30747 central 5 paf 1.170043 4468
upper lower central 0.1453304 4069.2501 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.369 28000 central 5 paf 1.170043 4069
upper upper central 0.1453304 4650.5716 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.369 32000 central 5 paf 1.170043 4651
upper central lower 0.0567717 1745.5580 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.124 30747 central 5 paf 1.060189 1746
upper lower lower 0.0567717 1589.6063 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.124 28000 central 5 paf 1.060189 1590
upper upper lower 0.0567717 1816.6929 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.124 32000 central 5 paf 1.060189 1817
upper central upper 0.2247829 6911.4001 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.664 30747 central 5 paf 1.289961 6911
upper lower upper 0.2247829 6293.9214 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.664 28000 central 5 paf 1.289961 6294
upper upper upper 0.2247829 7193.0531 1 FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10.00 1.664 32000 central 5 paf 1.289961 7193

Include summary uncertainty

TODO: add here Monte Carlo example

Example: attribute_health() with AR

Goal: attribute cases of high annoyance (HA) to noise exposure

exdat_noise_ha <-
  exdat_noise_ha |>
  dplyr::filter(!is.na(exdat_noise_ha$exposure_mean))

results_noise_ha <- attribute_health(
    approach_risk = "absolute_risk",
    exp_central = c(57.5, 62.5, 67.5, 72.5, 77.5),
    pop_exp = exdat_noise_ha$population_exposed_total,
    erf_eq_central = "78.9270-3.1162*c+0.0342*c^2"
)

TODO: hard code the function input

Source input data: NIPH
results_noise_ha[["health_detailed"]][["impact_raw"]] |> knitr::kable()
geo_id_disaggregated is_lifetable pop_exp prop_pop_exp exposure_name approach_risk exposure_dimension exposure_type exp_ci exp erf_ci erf_eq absolute_risk_as_percent impact
1 FALSE 387500 1 NA absolute_risk 1 exposure_distribution central 57.5 central 78.9270-3.1162c+0.0342c^2 12.81925 49674.594
1 FALSE 286000 1 NA absolute_risk 2 exposure_distribution central 62.5 central 78.9270-3.1162c+0.0342c^2 17.75825 50788.595
1 FALSE 191800 1 NA absolute_risk 3 exposure_distribution central 67.5 central 78.9270-3.1162c+0.0342c^2 24.40725 46813.105
1 FALSE 72200 1 NA absolute_risk 4 exposure_distribution central 72.5 central 78.9270-3.1162c+0.0342c^2 32.76625 23657.232
1 FALSE 7700 1 NA absolute_risk 5 exposure_distribution central 77.5 central 78.9270-3.1162c+0.0342c^2 42.83525 3298.314

Iteration example (1/)

Goal: attribute disease cases to PM2.5 exposure in multiple geographic units, such as municipalities, provinces, countries, …

Tip

  • For iterations, enter geo unit-specific inputs as lists use as.list() function

  • Feed unique geo ID’s to the `geo_id_disaggregated` argument (e.g. municipality names)

  • Optional: aggregate geo unit-specific results by providing higher-level ID’s (e.g. region names)

TODO: make printed table smaller, select relevant columns

TODO: mention that geo ids to be entered es vector

TODO: add name aggregated argument to bulb box

::: panel-tabset ## as.list(…)

results_iteration <- healthiar::attribute_health(
    geo_id_disaggregated = c("Zurich", "Basel", "Geneva", "Ticino", "Valais"), 
    geo_id_aggregated = c("Ger","Ger","Fra","Ita","Fra"),
    rr_central = 1.369,
    rr_increment = 10, 
    cutoff_central = 5,
    erf_shape = "log_linear",
    exp_central = as.list(c(11, 11, 10, 8, 7)),
    bhd_central = as.list(c(4000, 2500, 3000, 1500, 500))
)

Here the we want to aggregate results by language region ("Ger", "Fra", "Ita")

|> as.list()

TODO: remove pipe; replace as.list with list

results_iteration <- healthiar::attribute_health(
    geo_id_disaggregated = c("Zurich", "Basel", "Geneva", "Ticino", "Valais"), 
    geo_id_aggregated = c("Ger","Ger","Fra","Ita","Fra"),
    rr_central = 1.369,
    rr_increment = 10, 
    cutoff_central = 5,
    erf_shape = "log_linear",
    exp_central = c(11, 11, 10, 8, 7) |> as.list(),
    bhd_central = c(4000, 2500, 3000, 1500, 500) |> as.list()
)

:::

Let’s check the iteration output! (/)

Tip

The main output contains aggregated results if available, or disaggregated results if no aggregation ID was provided

results_iteration[["health_main"]]
geo_id_aggregated impact_rounded erf_ci exp_ci bhd_ci
Fra 466 central central central
Ger 1116 central central central
Ita 135 central central central

Example: Iteration - Analysis of multiple geo units

Analogously to the single geo unit example the iteration can also be run with uncertainties in one or more input variables.

results_iteration <- healthiar::attribute_health(
    geo_id_disaggregated = c("Zurich", "Basel", "Geneva", "Ticino", "Valais"), 
    geo_id_aggregated = c("Ger","Ger","Fra","Ita","Fra"),
    rr_central = 1.369, 
    rr_lower = 1.124,
    rr_upper = 1.664,
    rr_increment = 10, 
    cutoff_central = 5,
    erf_shape = "log_linear",
    exp_central = as.list(c(11, 11, 10, 8, 7)),
    exp_lower = as.list(c(10, 10, 9, 7, 6)),
    exp_upper = as.list(c(12, 12, 11, 9, 8)),
    bhd_central = as.list(c(4000, 2500, 3000, 1500, 500)),
    bhd_lower = as.list(c(3000, 1875, 2250, 1125, 375)),
    bhd_upper = as.list(c(5000, 3125, 3750, 1875, 625))
)
results_iteration[["health_detailed"]][["impact_raw"]]
exp_ci bhd_ci erf_ci pop_fraction impact geo_id_disaggregated geo_id_aggregated is_lifetable prop_pop_exp rr_increment erf_shape exposure_name approach_risk exposure_dimension exposure_type exp rr bhd cutoff_ci cutoff pop_fraction_type rr_conc impact_rounded
central central central 0.1717567 687.02680 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 4000 central 5 paf 1.207375 687
central lower central 0.1717567 515.27010 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 3000 central 5 paf 1.207375 515
central upper central 0.1717567 858.78350 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 5000 central 5 paf 1.207375 859
central central lower 0.0677332 270.93284 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 4000 central 5 paf 1.072654 271
central lower lower 0.0677332 203.19963 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 3000 central 5 paf 1.072654 203
central upper lower 0.0677332 338.66605 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 5000 central 5 paf 1.072654 339
central central upper 0.2632706 1053.08236 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 4000 central 5 paf 1.357350 1053
central lower upper 0.2632706 789.81177 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 3000 central 5 paf 1.357350 790
central upper upper 0.2632706 1316.35295 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 5000 central 5 paf 1.357350 1316
lower central central 0.1453304 581.32145 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 4000 central 5 paf 1.170043 581
lower lower central 0.1453304 435.99109 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 3000 central 5 paf 1.170043 436
lower upper central 0.1453304 726.65181 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 5000 central 5 paf 1.170043 727
lower central lower 0.0567717 227.08661 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 4000 central 5 paf 1.060189 227
lower lower lower 0.0567717 170.31496 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 3000 central 5 paf 1.060189 170
lower upper lower 0.0567717 283.85826 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 5000 central 5 paf 1.060189 284
lower central upper 0.2247829 899.13164 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 4000 central 5 paf 1.289961 899
lower lower upper 0.2247829 674.34873 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 3000 central 5 paf 1.289961 674
lower upper upper 0.2247829 1123.91454 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 5000 central 5 paf 1.289961 1124
upper central central 0.1973659 789.46375 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.369 4000 central 5 paf 1.245898 789
upper lower central 0.1973659 592.09781 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.369 3000 central 5 paf 1.245898 592
upper upper central 0.1973659 986.82969 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.369 5000 central 5 paf 1.245898 987
upper central lower 0.0785674 314.26953 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.124 4000 central 5 paf 1.085267 314
upper lower lower 0.0785674 235.70214 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.124 3000 central 5 paf 1.085267 236
upper upper lower 0.0785674 392.83691 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.124 5000 central 5 paf 1.085267 393
upper central upper 0.2998475 1199.38980 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.664 4000 central 5 paf 1.428260 1199
upper lower upper 0.2998475 899.54235 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.664 3000 central 5 paf 1.428260 900
upper upper upper 0.2998475 1499.23725 Zurich Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.664 5000 central 5 paf 1.428260 1499
central central central 0.1717567 429.39175 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 2500 central 5 paf 1.207375 429
central lower central 0.1717567 322.04381 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 1875 central 5 paf 1.207375 322
central upper central 0.1717567 536.73969 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 3125 central 5 paf 1.207375 537
central central lower 0.0677332 169.33303 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 2500 central 5 paf 1.072654 169
central lower lower 0.0677332 126.99977 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 1875 central 5 paf 1.072654 127
central upper lower 0.0677332 211.66628 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 3125 central 5 paf 1.072654 212
central central upper 0.2632706 658.17648 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 2500 central 5 paf 1.357350 658
central lower upper 0.2632706 493.63236 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 1875 central 5 paf 1.357350 494
central upper upper 0.2632706 822.72060 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 3125 central 5 paf 1.357350 823
lower central central 0.1453304 363.32591 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 2500 central 5 paf 1.170043 363
lower lower central 0.1453304 272.49443 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 1875 central 5 paf 1.170043 272
lower upper central 0.1453304 454.15738 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 3125 central 5 paf 1.170043 454
lower central lower 0.0567717 141.92913 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 2500 central 5 paf 1.060189 142
lower lower lower 0.0567717 106.44685 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 1875 central 5 paf 1.060189 106
lower upper lower 0.0567717 177.41141 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 3125 central 5 paf 1.060189 177
lower central upper 0.2247829 561.95727 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 2500 central 5 paf 1.289961 562
lower lower upper 0.2247829 421.46795 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 1875 central 5 paf 1.289961 421
lower upper upper 0.2247829 702.44659 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 3125 central 5 paf 1.289961 702
upper central central 0.1973659 493.41484 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.369 2500 central 5 paf 1.245898 493
upper lower central 0.1973659 370.06113 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.369 1875 central 5 paf 1.245898 370
upper upper central 0.1973659 616.76856 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.369 3125 central 5 paf 1.245898 617
upper central lower 0.0785674 196.41845 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.124 2500 central 5 paf 1.085267 196
upper lower lower 0.0785674 147.31384 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.124 1875 central 5 paf 1.085267 147
upper upper lower 0.0785674 245.52307 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.124 3125 central 5 paf 1.085267 246
upper central upper 0.2998475 749.61863 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.664 2500 central 5 paf 1.428260 750
upper lower upper 0.2998475 562.21397 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.664 1875 central 5 paf 1.428260 562
upper upper upper 0.2998475 937.02328 Basel Ger FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 12 1.664 3125 central 5 paf 1.428260 937
central central central 0.1453304 435.99109 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 3000 central 5 paf 1.170043 436
central lower central 0.1453304 326.99331 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 2250 central 5 paf 1.170043 327
central upper central 0.1453304 544.98886 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.369 3750 central 5 paf 1.170043 545
central central lower 0.0567717 170.31496 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 3000 central 5 paf 1.060189 170
central lower lower 0.0567717 127.73622 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 2250 central 5 paf 1.060189 128
central upper lower 0.0567717 212.89370 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.124 3750 central 5 paf 1.060189 213
central central upper 0.2247829 674.34873 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 3000 central 5 paf 1.289961 674
central lower upper 0.2247829 505.76154 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 2250 central 5 paf 1.289961 506
central upper upper 0.2247829 842.93591 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 10 1.664 3750 central 5 paf 1.289961 843
lower central central 0.1180609 354.18256 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.369 3000 central 5 paf 1.133865 354
lower lower central 0.1180609 265.63692 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.369 2250 central 5 paf 1.133865 266
lower upper central 0.1180609 442.72819 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.369 3750 central 5 paf 1.133865 443
lower central lower 0.0456812 137.04363 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.124 3000 central 5 paf 1.047868 137
lower lower lower 0.0456812 102.78272 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.124 2250 central 5 paf 1.047868 103
lower upper lower 0.0456812 171.30453 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.124 3750 central 5 paf 1.047868 171
lower central upper 0.1842846 552.85375 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.664 3000 central 5 paf 1.225918 553
lower lower upper 0.1842846 414.64031 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.664 2250 central 5 paf 1.225918 415
lower upper upper 0.1842846 691.06718 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.664 3750 central 5 paf 1.225918 691
upper central central 0.1717567 515.27010 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 3000 central 5 paf 1.207375 515
upper lower central 0.1717567 386.45258 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 2250 central 5 paf 1.207375 386
upper upper central 0.1717567 644.08763 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.369 3750 central 5 paf 1.207375 644
upper central lower 0.0677332 203.19963 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 3000 central 5 paf 1.072654 203
upper lower lower 0.0677332 152.39972 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 2250 central 5 paf 1.072654 152
upper upper lower 0.0677332 253.99954 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.124 3750 central 5 paf 1.072654 254
upper central upper 0.2632706 789.81177 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 3000 central 5 paf 1.357350 790
upper lower upper 0.2632706 592.35883 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 2250 central 5 paf 1.357350 592
upper upper upper 0.2632706 987.26471 Geneva Fra FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 11 1.664 3750 central 5 paf 1.357350 987
central central central 0.0899213 134.88190 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.369 1500 central 5 paf 1.098806 135
central lower central 0.0899213 101.16143 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.369 1125 central 5 paf 1.098806 101
central upper central 0.0899213 168.60238 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.369 1875 central 5 paf 1.098806 169
central central lower 0.0344604 51.69055 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.124 1500 central 5 paf 1.035690 52
central lower lower 0.0344604 38.76791 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.124 1125 central 5 paf 1.035690 39
central upper lower 0.0344604 64.61318 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.124 1875 central 5 paf 1.035690 65
central central upper 0.1416706 212.50586 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.664 1500 central 5 paf 1.165054 213
central lower upper 0.1416706 159.37939 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.664 1125 central 5 paf 1.165054 159
central upper upper 0.1416706 265.63232 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 8 1.664 1875 central 5 paf 1.165054 266
lower central central 0.0608838 91.32577 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.369 1500 central 5 paf 1.064831 91
lower lower central 0.0608838 68.49433 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.369 1125 central 5 paf 1.064831 68
lower upper central 0.0608838 114.15721 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.369 1875 central 5 paf 1.064831 114
lower central lower 0.0231076 34.66138 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.124 1500 central 5 paf 1.023654 35
lower lower lower 0.0231076 25.99603 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.124 1125 central 5 paf 1.023654 26
lower upper lower 0.0231076 43.32672 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.124 1875 central 5 paf 1.023654 43
lower central upper 0.0968303 145.24552 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.664 1500 central 5 paf 1.107212 145
lower lower upper 0.0968303 108.93414 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.664 1125 central 5 paf 1.107212 109
lower upper upper 0.0968303 181.55690 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 7 1.664 1875 central 5 paf 1.107212 182
upper central central 0.1180609 177.09128 Ticino Ita FALSE 1 10 log_linear NA relative_risk 1 population_weighted_mean 9 1.369 1500 central 5 paf 1.133865 177

Q&A I

Break

Example: compare()

Goal: comparison of two scenarios with the population impact fraction (PIF) or delta approach.

results_comparison <- compare(
    
     output_attribute_1 = 
       healthiar::attribute_health(
         exp_central = 8.85,
         cutoff_central = 5, 
         bhd_central = 25000,
         approach_risk = "relative_risk",
         erf_shape = "log_linear",
         rr_central = 1.118, rr_lower = 1.060, rr_upper = 1.179,
         rr_increment = 10,
         info = "PM2.5_mortality_2010"),
     
     output_attribute_2 = 
       healthiar::attribute_health(
         exp_central = 6, 
         cutoff_central = 5, 
         bhd_central = 25000,
         approach_risk = "relative_risk",
         erf_shape = "log_linear",
         rr_central = 1.118, rr_lower = 1.060, rr_upper = 1.179,
         rr_increment = 10,
         info = "PM2.5_mortality_2020"),
     
     approach_comparison = "delta"
)
results_comparison[["health_main"]]
impact impact_rounded impact_1 impact_2 bhd exp_1 exp_2 rr_conc_1 rr_conc_2
773.5564 774 1050.86 277.304 25000 8.85 6 1.043879 1.011217

Example: monetize()

Different monetization pathways available

  • Direct (default) after obtaining the health impacts
  • Indirect before the health impacts
  • Discounting yes/no
  • Inflation yes/no
  • Stand-alone use the function can either monetize a healthiar output or an “external” health impact
results_monetization <- 
  healthiar::monetize(
    output_healthiar = results_pm_copd,
    approach_discount = "direct",
    discount_shape = "exponential",
    discount_rate = 0.03,
    discount_years = 5,
    valuation = 20)

Example: socialize()

socialize() features

  • Stand-alone use the function can either be used with an attribute_... output or an external health impact
  • Deprivation indicator BEST-COST Multidimensional Deprivation Index (MDI) or any other (single-)indicator, e.g. house hold income

First create an example to be socialized using example data set exdat_mdi

results_social <- attribute_health(
    geo_id_disaggregated = exdat_mdi$CS01012020,
        rr_central = 1.08,
    erf_shape = "log_linear", 
    rr_increment = 10,
    exp_central = as.list(exdat_mdi$PM25_MEAN),
    cutoff_central = 0,
    bhd_central = as.list(exdat_mdi$MORTALITY_TOTAL),
    population = exdat_mdi$POPULATION
)
results_social <- healthiar::socialize(
  output_healthiar = results_social,
  geo_id_disaggregated = exdat_mdi$CS01012020,
  social_indicator = exdat_mdi$score,
  n_quantile = 10
)

Additional features

Additional existing healthiar functions

  • attribute_health() with the argument approach_multiexposure for analysis with correlated exposures
  • attribute_lifetable() for YLL
  • get_daly as the sum of YLL and YLD
  • attribute_mod() modify an existing healthiar assessment
  • cba() cost-benefit analysis
  • get_mdi() creates the BEST-COST Multidimensional Deprivation Index (MDI)

Note

Coming (relatively) soon: function examples in the intro vignette!

Post-healthiar workflow

Export results

write.csv(x = results_pm_copd$health_main, file = "exported_results/results_pm_copd.csv")
save(results_pm_copd, file = "exported_results/results_pm_copd.Rdata")
openxlsx::write.xlsx(x = results_pm_copd$health_main, file = "exported_results/results_pm_copd.xlsx")

Exported to .xlsx format

Visualize results

Visualization is out of scope of healthiar. You can visualize in

Homework - Exercises

Exercise 1 - RR

  • How many lung cancer cases are attributable to PM2.5 exposure in a single year?

    • With a cutoff of 5 microgram/m^3 ?

    • With no cutoff?

  • What’s the direct treatment costs per year?

Data

  • Population-weighted annual mean exposure: 10 microgram/m^3
  • Baseline health data: 100’000 cases per year
  • Relative risk: 1.06 per 10 microgram/m^3 exposure increment
  • ERF shape: linear
  • Average treatment cost: 50’000 EURO

Exercise 2 - AR

How many people are highly annoyed due to noise exposure

  • In total ?
  • In the highest exposure band ?

Advanced How large is the health burden measured in YLD? - Assume that the population is exposed for 1 year - Tip: check the function documentation of attribute_health to see which extra argument must be used to express the burden in YLD

Data

  • Use the data in the healthiar example data set exdat_noise_ha
  • Use the exposure values from the column exposure_mean
  • Use the ERF 90-3.1162*c+0.0342*c^2
  • Advanced disability weight = 0.02

Tip

Once healthiar is installed and loaded you can use the example data directly or add it to your Environment in RStudio by assigning it to a variable, e.g. data <- exdat_noise_ha

Q&A II

Conclusion

note: stress that they must install & test healthiar before 2nd WS

If you encounter challenges during installation, get in touch with us!

Thank you for your attention, and happy coding!

Appendix

Function documentation

Title section

The title summarizes the function of the function (hehe) in one sentence.

The title shows up next to the function name in the package landing page.

Description section provides additional details about the function’s purpose

Usage section In the usage section you can find a bare-minimum function “template”, which can either be auto-generated or created manually, as in this case.

Important

Any arguments that appear without a = symbol after them in the usage section have to be user-specified in all function call.

Note

The inputs to the arguments in the usage section are default inputs

Arguments section This is the core section of the function documentation, where input type (numeric vs. string) & input options (if available) are specified.

Details section (optional) Additional details about the function

Warning

Depending on the function, this section might be not very developed at the moment. Sometimes more function details are found in the intro vignette.

Value section Information about the function output

Example section (optional) Shows how the function works

Tip

By clicking on Run examples the example(s) are executed and the output shown

Example output Obtained by clicking on Run examples (see previous slide)

Solution Exercise 1

How many COPD cases are attributable to PM2.5 exposure in a single year?

results_with_cutoff <- attribute_health(
    erf_shape = "linear",
    rr_central = 1.06, 
    rr_increment = 10,  # μg / m^3
    exp_central = 10, # μg / m^3
    cutoff_central = 5, # μg / m^3
    bhd_central = 100000 # baseline health data: COPD incidence
)

# Attributable impact
print(results_with_cutoff$health_main$impact_rounded)
[1] 2913
results_no_cutoff <- attribute_health(
    erf_shape = "linear",
    rr_central = 1.06, 
    rr_increment = 10,
    exp_central = 10,
    cutoff_central = 0,
    bhd_central = 100000
)

# Attributable impact
print(results_no_cutoff$health_main$impact_rounded)
[1] 5660
results_monetized <- monetize(
  output_healthiar = results_no_cutoff,
  valuation = 50000
)

# Cost
print(results_monetized$monetization_main$monetized_impact_rounded)
[1] 283018868

Solution Exercise 2

results_noise_ha <- attribute_health(
    approach_risk = "absolute_risk",
    exp_central = exdat_noise_ha$exposure_mean,
    pop_exp = exdat_noise_ha$population_exposed_total,
    erf_eq_central = "90-3.1162*c+0.0342*c^2"
)

# Total attributable cases of high annoyance
print(results_noise_ha$health_main$impact_rounded)
[1] 278894
results_noise_ha <- attribute_health(
    approach_risk = "absolute_risk",
    exp_central = exdat_noise_ha$exposure_mean,
    pop_exp = exdat_noise_ha$population_exposed_total,
    erf_eq_central = "90-3.1162*c+0.0342*c^2"
)

# Attributable cases of high annoyance from exposure in highest noise band
print(results_noise_ha$health_detailed$impact_raw$impact[5])
[1] 4150.935
results_noise_ha_yld <- attribute_health(
    approach_risk = "absolute_risk",
    exp_central = exdat_noise_ha$exposure_mean,
    pop_exp = exdat_noise_ha$population_exposed_total,
    erf_eq_central = "90-3.1162*c+0.0342*c^2",
    dw_central = 0.02,
    duration_central = 1
)

# Attributable number of YLD due to high annoyance
print(results_noise_ha_yld$health_main$impact_rounded)
[1] 5578